#ifndef _ExtCleaner_H_
#define _ExtCleaner_H_

#include <Poco/SharedPtr.h>
#include <Poco/File.h>
#include <Poco/Path.h>
#include <Poco/DirectoryIterator.h>
#include <iostream>
#include <vector>

class ExtCleaner
{
public:
    ExtCleaner(void);

    ExtCleaner(const std::string & path);

    ExtCleaner(const Poco::DirectoryIterator & iterator);

    ExtCleaner(const Poco::File & file);

    ExtCleaner(const Poco::Path & path);

    virtual ~ExtCleaner(void);

    Poco::Path getCurPath() const;

    std::string getCurFileName() const;

    int addExt(const std::string & ext);

    int remExt(const std::string & ext);

    std::vector<std::string> getExt() const;

    int doRemove();

    int getDeleted() const;

private:
    Poco::SharedPtr<Poco::DirectoryIterator> _iter;
    Poco::SharedPtr<Poco::File> _file;
    std::vector<std::string> _exts;
    std::vector<std::string> _dirs;
    int _deleted;
};

#endif  //  _ExtCleaner_H_
